package com.mxt.moviedemo.dao;

import com.mxt.moviedemo.entity.Movies;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MoviesMapper {
    // 根据分页参数查询电影列表
    List<Movies> getMoviesByPage(PageRequest pageRequest);
    // 查询电影总数
    int getTotalMovies();

    List<Movies> searchMoviesByKeyword(PageRequest pageRequest, String keyword);
    int getTotalMoviesByKeyword(String keyword);

    Movies getMovieById(int mid);
}
